import { defineUniPages } from '@uni-helper/vite-plugin-uni-pages';

export default defineUniPages({
  globalStyle: {
    navigationStyle: 'default',
    navigationBarTitleText: 'eacloud',
    navigationBarBackgroundColor: '@navigationBarBackgroundColor',
    navigationBarTextStyle: '@navigationBarTextStyle',
    backgroundColor: '@backgroundColor',
  },
  easycom: {
    autoscan: true,
    custom: {
      '^ea-(.*)': '@/components/ea-$1/**/ea-$1.vue',
      '^wd-(.*)': 'wot-design-uni/components/wd-$1/wd-$1.vue',
      '^(?!z-paging-refresh|z-paging-load-more)z-paging(.*)':
        'z-paging/components/z-paging$1/z-paging$1.vue',
    },
  },
  // 如果不需要tabBar，可以注释掉这个配置，或者直接删除。
  tabBar: {
    custom: true, // 自定义 tabBar
    color: '@tabBarColor',
    selectedColor: '@tabBarSelectedColor',
    borderStyle: '@tabBarBorderStyle',
    backgroundColor: '@tabBarBackgroundColor',
    height: '0', // 使用自定义 tabBar 时，建议将 tabBar 默认高度设置为 0，已优化初始闪现的问题。
    fontSize: '10px',
    iconWidth: '24px',
    spacing: '3px',
    list: [
      // 自定义 tabBar 的路由需要使用 layout:tabbar 布局
      {
        id: 'home',
        pagePath: 'pages/index/index',
        text: '%tabBar.homeText%',
        iconType: 'unocss',
        icon: 'i-ant-design:home-outlined',
        selectedIcon: 'i-ant-design:home-filled',
        avatarType: 'local',
        avatar: '/static/images/tabbar/home_avatar@128x.png',
      },
      {
        id: 'task',
        pagePath: 'pages/about/login',
        text: '%tabBar.taskText%',
        iconType: 'unocss',
        icon: 'i-ph:calendar-check-light',
        selectedIcon: 'i-ph:calendar-check-fill',
        avatarType: 'local',
        avatar: '/static/images/tabbar/task_avatar@128x.png',
        visible: false,
      },
      {
        id: 'workbench',
        pagePath: 'pages/about/spEditor',
        text: '%tabBar.workbenchText%',
        iconType: 'unocss',
        icon: 'i-ri:dashboard-horizontal-line',
        selectedIcon: 'i-ri:dashboard-horizontal-fill',
        avatarType: 'local',
        avatar: '/static/images/tabbar/workbench_avatar@128x.png',
      },
      {
        id: 'report',
        pagePath: 'pages/about/about',
        text: '%tabBar.reportText%',
        iconType: 'unocss',
        icon: 'i-mdi:report-box-outline',
        selectedIcon: 'i-mdi:report-box',
        avatarType: 'local',
        avatar: '/static/images/tabbar/report_avatar@128x.png',
        visible: false,
      },
      {
        id: 'profile',
        pagePath: 'pages/sys/profile/index',
        text: '%tabBar.profileText%',
        iconType: 'unocss',
        icon: 'i-mdi:smiley-wink-outline',
        selectedIcon: 'i-mdi:smiley-wink',
        avatarType: 'local',
        avatar: '/static/images/tabbar/profile_avatar@128x.png',
      },
    ],
  },
});
